#ifndef _acceptor_h_
#define _acceptor_h_
#include"IMessageChannelFactory.h"
#include"IMessageSystem.h"
#include"Selector.h"

class Acceptor
{
public:
	Acceptor(IMessageChannelFactory* pf,Selector* pSelector,IMessageSystem::CallBack::OnAccept a,void* pTag);	

	void								Listen(const char* ip,unsigned short port,int backlog=10);

	void								Poll();

private:
	SOCKET								m_socket;	
	Selector*							m_pSelector;
	IMessageChannelFactory*				m_pFactory;
	IMessageSystem::CallBack::OnAccept	m_OnAccept;
	void* m_pTag;
};

#endif